{php $bootstrap_type = 3;}
{template 'header'}
<style type='text/css'>
    .sel { background:#e9342a; color:#fff;}
    .nosel { background:#fff;color:#000}
</style>
<link type="text/css" rel="stylesheet" href="../addons/eso_sale/images/style.css">
<div class="head">
    <a href="javascript:history.back();" class="bn pull-left"><i class="fa fa-angle-left"></i></a>
    <span class="title">我的订单</span>
    <a href="{php echo $this->createMobileUrl('mycart')}" class="bn pull-right"><i class="fa fa-shopping-cart"></i></a>
</div>
 <div class="myoder img-rounded" style='color:#aaa;padding:5px;'>
<div>姓名：{$fans['realname']}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 电话：{$fans['mobile']}</div>
<div>余额：{$fans['credit2']} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 积分：{$fans['credit1']}</div>
</div>
 <div class="myoder img-rounded" style='text-align:center;color:#aaa;padding:5px;'>
     <div style='float:left;height:30px;margin:auto;width:60%;'>
    <div {if $status==0}class='sel'{else}class="nosel"{/if} style='border-top-left-radius: 5px;border-bottom-left-radius:5px;border:1px solid #e9342a;text-align: center;float:left;width:30%' onclick="location.href='{php echo $this->mturl('myorder',array('status'=>0))}'">
        待支付
    </div>
    <div {if $status==1 || $status==2}class='sel'{else}class="nosel"{/if} style='border:1px solid #e9342a;margin-left:-1px;float:left;width:30%;text-align: center;' onclick="location.href='{php echo $this->mturl('myorder',array('status'=>2))}'">
        待收货
    </div>
    <div {if $status==3}class='sel'{else}class="nosel"{/if} style='border-top-right-radius: 5px;margin-left:-1px;border-bottom-right-radius:5px;text-align: center;border:1px solid #e9342a;float:left;width:30%' onclick="location.href='{php echo $this->mturl('myorder',array('status'=>3))}'">
        已完成
    </div>
</div>
     <a style='float:right;' href="{php echo $this->mturl('address', array('from'=>'confirm'))}">管理收货地址</a>
</div>



{if count($list)<=0}
<div class="myoder img-rounded" style='text-align:center;color:#aaa;padding:30px;'>
    您暂时没有任何订单!
</div>
{/if}
<div style='margin-bottom:40px;'>
{loop $list $item}
<div class="myoder img-rounded">
	<div class="myoder-hd">
		<span class="pull-left">订单编号：{$item['ordersn']}</span>
		<span class="pull-right">{php echo date('Y-m-d H:i', $item['createtime'])}
        {if $item['paytype'] == 3}
			{if $item['status'] == -1}
			<span class="text-muted">订单取消</span>
			{elseif $item['status'] < 3}
			<span class="text-danger">货到付款 / 未付款</span>
			{else}
			<span class="text-success">已完成</span>
			{/if}
		{else}
			{if $item['status'] == -1}
			<span class="text-muted">订单取消</span>
			{elseif $item['status'] == 0}
			<span class="text-danger">未付款</span>
			{elseif $item['status'] == 1}
			<span class="text-warning">已付款</span>
			{elseif $item['status'] == 2}
			<span class="text-warning">已发货</span>
			{else}
			<span class="text-success">已完成</span>
			{/if}
		{/if}
                </span>
	</div>
                  {if count($item['goods'])==1}
	{loop $item['goods'] $goods}
	<div class="myoder-detail">
		<a href="{php echo $this->mturl('detail', array('id' => $goods['id']))}"><img src="{$_W['attachurl']}{$goods['thumb']}" width="160"></a>
		<div class="pull-left">
			<div class="name"><a href="{php echo $this->mturl('detail', array('id' => $goods['id']))}">{$goods['title']}</a></div>
			<div class="price">
				<span>{$goods['marketprice']} 元{if $goods['unit']} / {$goods['unit']}{/if}</span>
				<span class="num">{$item['total'][$goods['id']]['total']}{if $goods['unit']} {$goods['unit']}{/if}</span>
			</div>
		</div>
	</div>
	{/loop}
        {else}
       
	<div class="myoder-detail">
             {loop $item['goods'] $goods}
		<a href="{php echo $this->mturl('detail', array('id' => $goods['id']))}"><img src="{$_W['attachurl']}{$goods['thumb']}" width="160"></a>
                {/loop}
	</div>
	
        {/if}
	 
	<div class="myoder-total">
		<span>共计：<span class="false"> {if $item['dispatchprice']<=0}
                        {$item['price']} 元
                        {else}
                        {$item['price']} 元 (运费 {$item['dispatchprice']} 元) 
                        {/if}</span></span>
	 	<a href="{php echo $this->mturl('myorder', array('orderid' => $item['id'], 'op' => 'detail'))}" class="btn btn-success pull-right btn-sm" >订单详情</a>
		 
	</div>
</div>
{/loop}</div>


<script src="../addons/eso_sale/recouse/js/zepto.min.js" type="text/javascript"></script>
<script type="text/javascript">
Zepto(function($){
   var $nav = $('.global-nav'), $btnLogo = $('.global-nav__operate-wrap');
   //点击箭头，显示隐藏导航
   $btnLogo.on('click',function(){
     if($btnLogo.parent().hasClass('global-nav--current')){
       navHide();
     }else{
       navShow();
     }
   });
   var navShow = function(){
     $nav.addClass('global-nav--current');
   }
   var navHide = function(){
     $nav.removeClass('global-nav--current');
   }
   
   $(window).on("scroll", function() {
		if($nav.hasClass('global-nav--current')){
			navHide();
		}
	});
})
function get_search_box(){
	try{
		document.getElementById('get_search_box').click();
	}catch(err){
		document.getElementById('keywordfoot').focus();
 	}
}
</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
    //获取指定cookes函数
    function getCookie(name)
    {
        var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");

        if(arr=document.cookie.match(reg))

            return unescape(arr[2]);
        else
            return null;
    }

    if(navigator.appName == 'Microsoft Internet Explorer'){
        if(navigator.userAgent.indexOf("MSIE 5.0")>0 || navigator.userAgent.indexOf("MSIE 6.0")>0 || navigator.userAgent.indexOf("MSIE 7.0")>0) {
            alert('您使用的 IE 浏览器版本过低, 推荐使用 Chrome 浏览器或 IE8 及以上版本浏览器.');
        }
    }

    // jssdk config 对象
    jssdkconfig = {php echo json_encode($_W['account']['jssdkconfig']);} || {};
    // 是否启用调试
    jssdkconfig.debug = false;
    //
    jssdkconfig.jsApiList = [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',
        'translateVoice',
        'startRecord',
        'stopRecord',
        'onRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'uploadVoice',
        'downloadVoice',
        'chooseImage',
        'previewImage',
        'uploadImage',
        'downloadImage',
        'getNetworkType',
        'openLocation',
        'getLocation',
        'hideOptionMenu',
        'showOptionMenu',
        'closeWindow',
        'scanQRCode',
        'chooseWXPay',
        'openProductSpecificView',
        'addCard',
        'chooseCard',
        'openCard'
    ];

    var wxData = {
        //"appId": "{$_W['account']['key']}",
        "imgUrl" : '{$_W['siteroot']}/source/modules/eso_sale/icon.jpg',
        "link" : '{php echo $_W['siteroot']."app/".$this->mturl('list',array('id'=>$id))}&mid='+getCookie("mid"),
        "desc" : '看你能捞多少佣金',
        "title" : '{$_W['account']['name']}'
    };

    wx.config(jssdkconfig);
    wx.ready(function () {
        wx.onMenuShareAppMessage(wxData);
        wx.onMenuShareTimeline(wxData);
        wx.onMenuShareQQ(wxData);
        wx.onMenuShareWeibo(wxData);
    });
</script>
{template 'footerbar'}
</body>
</html>